<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE UnboxedTuples #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Utils.Monad.State</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-keyword">newtype</span><span> </span><span id="State"><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span></span><span> </span><span id="local-6989586621680778613"><span class="annot"><a href="#local-6989586621680778613"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621680778612"><span class="annot"><a href="#local-6989586621680778612"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="State"><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="runState%27"><span class="annot"><span class="annottext">forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621680778613"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><a href="#local-6989586621680778612"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621680778613"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-9"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680778542"><span id="local-6989586621680778544"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; State s a -&gt; State s b)
-&gt; (forall a b. a -&gt; State s b -&gt; State s a) -&gt; Functor (State s)
forall a b. a -&gt; State s b -&gt; State s a
forall a b. (a -&gt; b) -&gt; State s a -&gt; State s b
forall s a b. a -&gt; State s b -&gt; State s a
forall s a b. (a -&gt; b) -&gt; State s a -&gt; State s b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; State s b -&gt; State s a
$c&lt;$ :: forall s a b. a -&gt; State s b -&gt; State s a
fmap :: forall a b. (a -&gt; b) -&gt; State s a -&gt; State s b
$cfmap :: forall s a b. (a -&gt; b) -&gt; State s a -&gt; State s b
</span><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span id="local-6989586621680778592"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680778530"><span id="local-6989586621680778532"><span id="local-6989586621680778534"><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778592"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-12"></span><span>   </span><span id="local-6989586621680778528"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; State s a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621680778527"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778527"><span class="hs-identifier hs-var">x</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; (# a, s #)) -&gt; State s a
forall s a. (s -&gt; (# a, s #)) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; (# a, s #)) -&gt; State s a) -&gt; (s -&gt; (# a, s #)) -&gt; State s a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680778526"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778526"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778527"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778526"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-13"></span><span>   </span><span id="local-6989586621680778525"><span class="annot"><span class="annottext">State s (a -&gt; b)
</span><a href="#local-6989586621680778525"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680778524"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. State s (a -&gt; b) -&gt; State s a -&gt; State s b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span id="local-6989586621680778523"><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778523"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; (# b, s #)) -&gt; State s b
forall s a. (s -&gt; (# a, s #)) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; (# b, s #)) -&gt; State s b) -&gt; (s -&gt; (# b, s #)) -&gt; State s b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680778522"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778522"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State s (a -&gt; b) -&gt; s -&gt; (# a -&gt; b, s #)
forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span><span> </span><span class="annot"><span class="annottext">State s (a -&gt; b)
</span><a href="#local-6989586621680778525"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778522"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-14"></span><span>                            </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680778521"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621680778521"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680778520"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778520"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State s a -&gt; s -&gt; (# a, s #)
forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span><span> </span><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778523"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778520"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-15"></span><span>                                           </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680778519"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778519"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680778518"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778518"><span class="hs-identifier hs-var">s''</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621680778521"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778519"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778518"><span class="hs-identifier hs-var">s''</span></a></span><span> </span><span class="hs-special">#)</span></span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span id="local-6989586621680778579"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680778511"><span id="local-6989586621680778513"><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778579"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-18"></span><span>    </span><span id="local-6989586621680778509"><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778509"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680778508"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. State s a -&gt; (a -&gt; State s b) -&gt; State s b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621680778507"><span class="annot"><span class="annottext">a -&gt; State s b
</span><a href="#local-6989586621680778507"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; (# b, s #)) -&gt; State s b
forall s a. (s -&gt; (# a, s #)) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; (# b, s #)) -&gt; State s b) -&gt; (s -&gt; (# b, s #)) -&gt; State s b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680778506"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778506"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State s a -&gt; s -&gt; (# a, s #)
forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span><span> </span><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778509"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778506"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-19"></span><span>                             </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680778505"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778505"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680778504"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778504"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">State s b -&gt; s -&gt; (# b, s #)
forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; State s b
</span><a href="#local-6989586621680778507"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778505"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778504"><span class="hs-identifier hs-var">s'</span></a></span></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span id="local-6989586621680778576"><span class="annot"><a href="GHC.Utils.Monad.State.html#get"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778576"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778576"><span class="hs-identifier hs-type">s</span></a></span></span><span>
</span><span id="line-22"></span><span id="get"><span class="annot"><span class="annottext">get :: forall s. State s s
</span><a href="GHC.Utils.Monad.State.html#get"><span class="hs-identifier hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; (# s, s #)) -&gt; State s s
forall s a. (s -&gt; (# a, s #)) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; (# s, s #)) -&gt; State s s) -&gt; (s -&gt; (# s, s #)) -&gt; State s s
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680778502"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778502"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778502"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778502"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span id="local-6989586621680778573"><span id="local-6989586621680778574"><span class="annot"><a href="GHC.Utils.Monad.State.html#gets"><span class="hs-identifier hs-type">gets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680778574"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680778573"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778574"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778573"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-25"></span><span id="gets"><span class="annot"><span class="annottext">gets :: forall s a. (s -&gt; a) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#gets"><span class="hs-identifier hs-var hs-var">gets</span></a></span></span><span> </span><span id="local-6989586621680778500"><span class="annot"><span class="annottext">s -&gt; a
</span><a href="#local-6989586621680778500"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; (# a, s #)) -&gt; State s a
forall s a. (s -&gt; (# a, s #)) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; (# a, s #)) -&gt; State s a) -&gt; (s -&gt; (# a, s #)) -&gt; State s a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680778499"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778499"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">s -&gt; a
</span><a href="#local-6989586621680778500"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778499"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778499"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span id="local-6989586621680778570"><span class="annot"><a href="GHC.Utils.Monad.State.html#put"><span class="hs-identifier hs-type">put</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621680778570"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778570"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-28"></span><span id="put"><span class="annot"><span class="annottext">put :: forall s. s -&gt; State s ()
</span><a href="GHC.Utils.Monad.State.html#put"><span class="hs-identifier hs-var hs-var">put</span></a></span></span><span> </span><span id="local-6989586621680778497"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778497"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; (# (), s #)) -&gt; State s ()
forall s a. (s -&gt; (# a, s #)) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; (# (), s #)) -&gt; State s ())
-&gt; (s -&gt; (# (), s #)) -&gt; State s ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778497"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span id="local-6989586621680778568"><span class="annot"><a href="GHC.Utils.Monad.State.html#modify"><span class="hs-identifier hs-type">modify</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680778568"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680778568"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778568"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-31"></span><span id="modify"><span class="annot"><span class="annottext">modify :: forall s. (s -&gt; s) -&gt; State s ()
</span><a href="GHC.Utils.Monad.State.html#modify"><span class="hs-identifier hs-var hs-var">modify</span></a></span></span><span> </span><span id="local-6989586621680778495"><span class="annot"><span class="annottext">s -&gt; s
</span><a href="#local-6989586621680778495"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; (# (), s #)) -&gt; State s ()
forall s a. (s -&gt; (# a, s #)) -&gt; State s a
</span><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-var">State</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; (# (), s #)) -&gt; State s ())
-&gt; (s -&gt; (# (), s #)) -&gt; State s ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680778494"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778494"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s -&gt; s
</span><a href="#local-6989586621680778495"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778494"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span id="local-6989586621680778565"><span id="local-6989586621680778566"><span class="annot"><a href="GHC.Utils.Monad.State.html#evalState"><span class="hs-identifier hs-type">evalState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778566"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778565"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680778566"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680778565"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-35"></span><span id="evalState"><span class="annot"><span class="annottext">evalState :: forall s a. State s a -&gt; s -&gt; a
</span><a href="GHC.Utils.Monad.State.html#evalState"><span class="hs-identifier hs-var hs-var">evalState</span></a></span></span><span> </span><span id="local-6989586621680778492"><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778492"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621680778491"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778491"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State s a -&gt; s -&gt; (# a, s #)
forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span><span> </span><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778492"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778491"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-36"></span><span>                </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680778490"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778490"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778490"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span id="local-6989586621680778561"><span id="local-6989586621680778562"><span class="annot"><a href="GHC.Utils.Monad.State.html#execState"><span class="hs-identifier hs-type">execState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778562"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778561"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680778562"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680778562"><span class="hs-identifier hs-type">s</span></a></span></span></span><span>
</span><span id="line-40"></span><span id="execState"><span class="annot"><span class="annottext">execState :: forall s a. State s a -&gt; s -&gt; s
</span><a href="GHC.Utils.Monad.State.html#execState"><span class="hs-identifier hs-var hs-var">execState</span></a></span></span><span> </span><span id="local-6989586621680778488"><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778488"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621680778487"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778487"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State s a -&gt; s -&gt; (# a, s #)
forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span><span> </span><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778488"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778487"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-41"></span><span>                </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680778486"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778486"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778486"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span id="local-6989586621680778557"><span id="local-6989586621680778558"><span class="annot"><a href="GHC.Utils.Monad.State.html#runState"><span class="hs-identifier hs-type">runState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.State.html#State"><span class="hs-identifier hs-type">State</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778558"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680778557"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680778558"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680778557"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621680778558"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-45"></span><span id="runState"><span class="annot"><span class="annottext">runState :: forall s a. State s a -&gt; s -&gt; (a, s)
</span><a href="GHC.Utils.Monad.State.html#runState"><span class="hs-identifier hs-var hs-var">runState</span></a></span></span><span> </span><span id="local-6989586621680778484"><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778484"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621680778483"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778483"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State s a -&gt; s -&gt; (# a, s #)
forall s a. State s a -&gt; s -&gt; (# a, s #)
</span><a href="GHC.Utils.Monad.State.html#runState%27"><span class="hs-identifier hs-var hs-var">runState'</span></a></span><span> </span><span class="annot"><span class="annottext">State s a
</span><a href="#local-6989586621680778484"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778483"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-46"></span><span>               </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680778482"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778482"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680778481"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778481"><span class="hs-identifier hs-var">s'</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680778482"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621680778481"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-47"></span></pre></body></html>